import { View } from '@tarojs/components';
import React from 'react';
import styles from './index.module.scss';

const ProductTags = ({ tagList, hasTag = !!tagList?.length, className = '' }) => {
  if (!hasTag) {
    return null;
  }

  return (
    <View className={`${styles.ProductTags} ProductTags omit customePageStyle ${className}`}>
      {tagList?.map((str) => {
        return (
          <View className="tag customeSalesPromotionLabelStyle" key={str}>
            <View className="txt">{str}</View>
          </View>
        );
      })}
    </View>
  );
};

export default ProductTags;
